How to format the report: overview

When the Standard Report Wizard ends, the raw report displays in Preview view of the Crystal Reports Designer:

Our objective is to format the report as follows:

Note: Most, though not all, changes can be performed in either Preview view or Design view (select the Design or Preview tab on the left hand side of the screen). Design view is most versatile however, so in this exercise, select the Design tab.

Edit the Column headings:

  1. In the Page Header section of the report, double-click a column label (OrdDateofEvent in this example) to select it and double-click again to highlight it:

  2. Enter an appropriate heading (e.g. Event Date) and format as required using the standard Windows formatting tools (font weight, style, alignment, etc.).
  3. Position the headings and data as required.

    Be sure to move a heading and its data together. The easiest way to do this in Design view is to select the data and move that: the heading will move automatically. With one or more objects selected, it's a simple matter to drag the selection to a new location (or use the arrow keys on your keyboard). Use CTRL+Click to select more than one object at a time.

    Note: Moving fields and data is probably achieved more easily in Design view, but you may wish to switch back and forth between Design and Preview views to see the result of any changes to the position of fields as data does not display in Design view. You may find it necessary to resize a data field in order that all of its data displays.

  4. In this example, we don't want to display the Print Date (see the screenshot under Step 1) or Group Name, so we'll delete them. Make sure you are in Design view.

    To delete fields:

    1. Right-click the field, e.g. Print Date in the Page Header.
    2. Select Delete from the context menu that displays.
  5. To format numbers and dates, right-click the data (not its heading).

    In Design view, the data field is located in the Details section of the report.

    You may however find this step easier in Preview view, where you can simply right-click the data.

  6. Select Format Field from the context menu that displays.

    The Format Editor box displays.

  7. Select the date / number format required and click OK.
  8. In this example, two group summaries were added to the Group Footer section of the Report. We'll:
    • Reposition the data fields
    • Resize them so they match each other
    • Add field labels for them:
    1. Position the summaries so that the Sum summary (which we'll label as Total) sits below the Average summary. Moving fields is perhaps best managed in Design view.
      1. Click the field. Its borders will turn blue.
      2. Place the cursor over the left side of the blue rectangle until it changes from a cross to a double-ended arrow.
      3. Click and drag the left hand side of the rectangle to achieve the new size.
    2. To ensure they are exactly the same size:
      1. Press CTRL and click both fields.
      2. Right-click one of the fields (the one you believe is the correct width) and select Size>Same Width from the context menu that displays.
    3. Right-click the report to the left of the unlabeled data field and select Insert Text Object from the context menu that displays.

      The cursor changes to a cross-hair. Drag out a rectangle for the label.

    4. Add text (e.g. Total: or Sum:), format it and position the label as required.
  9. If you were to examine this report you would find that the grouping is by week.

    To group by year, for example:

    1. Make sure that you are in Design view.
    2. Right-click Group Header #1: in the left hand column of the Crystal Reports Designer (this section sits below Page Header and above Details).

      If a warning message displays, click OK.

    3. Select Change Group from the context menu that displays.
    4. Select for each year from the This section will be printed drop list.
  10. To format the chart: right-click the chart and select Chart Expert from the context menu that displays.
  11. Select the Type tab to change the type of graph if required. Select the type of graph to use from the Choose your chart type list (e.g. Bar). In this example the depth effect option available on this tab was selected.
  12. Select the Data tab to change the data that is to be graphed if required:

    If a report already contains grouping and summary information, the Chart Expert uses this information by default. You would select alternate data from the drop lists or select the Advanced button in the left hand column to configure the Chart data from scratch.

  13. Select the Text tab and add the required titles and specify the font for each:

  14. Click OK to close the Chart Expert.
  15. Centre the chart on the page (this is achieved most easily in Design view):

    In this example we grouped a number of fields in Vitalware and when the report is run a .csv file called Group1.csv is created. To include these values in the report we need to add a subreport.

  16. If the headings need to be aligned horizontally:
    1. Position a heading correctly and click it (or simply click a heading that is positioned correctly).
    2. Press the CTRL key on the keyboard and then click the other headings.
  17. Right-click the correctly positioned heading.

    From the context menu that displays, select Align>Bottoms:

    The headings will align correctly:

    The same technique can be used to align all the headings (horizontally), as well as a heading and its data (vertically).

  18. Select File>Save to save the report.

    Note: When selecting saving File>Save to save the report, check that the Save Data with Report option is not ticked. This option sits below the Save option in the File menu.

    The final step is to save the report back to Vitalware so that the report can be run from within Vitalware.